package cn.butcher21.utils;

import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.stage.Stage;

import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * butcher create in 2021/05/14/15:13
 */
public class BuildScene {
    // 存放初始化好的舞台
    public static Map<String, Stage> stages = new HashMap<String, Stage>();
    public static Map<String, Parent> parents = new HashMap<String, Parent>();

    public BuildScene() {
        try {
            parents.put("sale", (Parent) FXMLLoader.load(getClass().getResource("../view/sale.fxml")));
            parents.put("setting", (Parent) FXMLLoader.load(getClass().getResource("../view/setting.fxml")));
            parents.put("stock", (Parent) FXMLLoader.load(getClass().getResource("../view/stock.fxml")));
            parents.put("chart", (Parent) FXMLLoader.load(getClass().getResource("../view/chart.fxml")));
            parents.put("user", (Parent) FXMLLoader.load(getClass().getResource("../view/user.fxml")));
            System.out.println("parent初始化完毕！" + new Date().toString());
        } catch (IOException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
